package com.ht.module.common.controller;

import com.ht.module.common.service.ICommonService;
import com.ht.util.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @ProjectName: ht_screen
 * @ClassName: CommonController
 * @Author: hejialun
 * @Description: 公共控制层
 * @Date: 2021/8/11 10:05
 */
@Api(tags = "公共控制层 ")
@RestController
@RequestMapping("/common")
public class CommonController {

    @Autowired
    private ICommonService commonService;


    /**
     * 文件上传
     */
    @ApiOperation(value = "文件上传")
    @PostMapping("/uploadFile")
    public JsonResult uploadFile(MultipartFile file) throws IOException {
        return JsonResult.success(commonService.uploadFile(file));
    }

}